﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="Work.UI.Web.Forms.Admin.Employers.Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentHeader" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<asp:ObjectDataSource ID="odsEmployer" runat="server"
        TypeName="Work.BL.Hibernate.Managers.HProfileEmployerManager"
        DataObjectTypeName="Work.BL.POCOs.ProfileEmployerPOCO"
        SelectMethod="GetEmployerById"
        UpdateMethod="Edit"
        onobjectcreating="odsEmployer_ObjectCreating">

            <SelectParameters>
                <asp:QueryStringParameter Name="Id" QueryStringField="Id" Type="Int32" />
            </SelectParameters>

        </asp:ObjectDataSource>

    <asp:FormView ID="frvEmployer"  runat="server"
        DataSourceID="odsEmployer"
        DataKeyNames="Id" DefaultMode="Edit" 
        OnItemUpdated="frvEmployer_ItemUpdate" >

        <EditItemTemplate>

            <table class="addEdit">

                <tr>
                    <td>Company: </td>
                    <td>
                        <asp:TextBox ID="tbCompany" Text='<%# Bind("Company") %>' runat="server"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ErrorMessage="Required field"
                                ValidationGroup="Employer"
                                ControlToValidate="tbCompany" 
                                Display="Dynamic"/>
                        <asp:RegularExpressionValidator ID="revSmallName" runat="server" 
                                ErrorMessage="Length should not exceed 25"                                                                                                             
                                ControlToValidate="tbCompany"
                                ValidationGroup="Employer" 
                                ValidationExpression=".{1,25}"
                                Display="Dynamic" />
                    </td>
                </tr>

                <tr>
                    <td>Type: </td>
                    <td>
                        <asp:TextBox ID="tbType" Text='<%# Bind("Type") %>' runat="server"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ErrorMessage="Required field"
                                ValidationGroup="Employer"
                                ControlToValidate="tbType" 
                                Display="Dynamic"/>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ErrorMessage="Length should not exceed 25"                                                                                                             
                                ControlToValidate="tbType"
                                ValidationGroup="Employer" 
                                ValidationExpression=".{1,25}"
                                Display="Dynamic" />
                    </td>
                </tr>
                <tr>
                    <td>Phone: </td>
                    <td>
                        <asp:TextBox ID="tbPhone" Text='<%# Bind("Phone") %>' runat="server"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                ErrorMessage="Required field"
                                ValidationGroup="Employer"
                                ControlToValidate="tbPhone" 
                                Display="Dynamic"/>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                ErrorMessage="Length should not exceed 25"                                                                                                             
                                ControlToValidate="tbPhone"
                                ValidationGroup="Employer" 
                                ValidationExpression=".{1,25}"
                                Display="Dynamic" />
                    </td>
                </tr>

            </table>
            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("IdUser") %>' Visible="false"></asp:TextBox>
            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("IdRegion") %>' Visible="false"></asp:TextBox>

            <asp:LinkButton ID="AddUser" runat="server" ValidationGroup="Employer"
                onclick="AddEmployer_Click" CausesValidation="true" CssClass="button1">
                    <strong>Edit</strong>
                </asp:LinkButton>

            <asp:LinkButton ID="LinkButton1" runat="server"
                onclick="Cansel_Click" CausesValidation="true" CssClass="button1">
                    <strong>Cansel</strong>
                </asp:LinkButton>
                
            </EditItemTemplate>

        </asp:FormView>
</asp:Content>
